<template>
  <nav>
    <router-link :to="`${base}/`">Home</router-link> |
    <router-link :to="`${base}/about`">About</router-link>
  </nav>
  <div @click="debounce">test</div>
  <router-view/>
</template>

<script lang="ts">
import { defineComponent, computed } from 'vue'
import store from '@/store'
import * as _ from 'lodash'

export default defineComponent({
  setup () {
    const base = computed(() => store.getters.getBaseUrl)

    const debounce = _.debounce(() => { console.log(111) }, 1000)

    return {
      base,
      debounce
    }
  }
})
</script>

<style lang="less">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>
